#ifndef _QY_TCP_SERVER_H
#define _QY_TCP_SERVER_H

namespace qy
{

class TCPServer
{
public:
	TCPServer(int port); 
	virtual ~TCPServer();

	bool listen(int queueSize = 10);
	int accept();
	void close();

	bool fail();
	int port() { return m_port; }

private:
	TCPServer(const TCPServer &server) {}
	TCPServer &operator=(const TCPServer &server) {}

private:
	int m_sock;
	int m_port;
};

}

#endif
